[mirrors]
http://gondor.apana.org.au/~herbert/dash/files/dash-0.5.8.tar.gz

[vars]
filesize=223028
sha512=3dc42d3503b33c50b62c0f9104c0e41c4e8fa7490ba72bc09213fcc894d6fd92b9688c58389acf8b538b08f8e9cc179f0bf5572e22175d1960f04554594237b8
desc="debian almquist shell, a strictly POSIX conforming shell"

[deps]

[build]
cat << EOF > nl.c
#include <stdio.h>
int main() {
	/* the way nl is invoked (-v 0) means we should start with 0 */
        size_t i = 0; char b[4096];
        while(fgets(b, sizeof b, stdin)) { printf("%zu %s", i, b); i++; }
}

EOF
# dash mkbuiltins script depends on "nl"
$HOSTCC nl.c -o nl
export PATH="$PWD:$PATH"

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

LC_CTYPE=C CFLAGS="-D_GNU_SOURCE -D__KLIBC__ $optcflags -g" \
LDFLAGS="$optldflags -static" \
  ./configure -C --prefix="$butch_prefix" $xconfflags

LC_CTYPE=C make -j$MAKE_THREADS CC_FOR_BUILD="$HOSTCC"
make DESTDIR="$butch_install_dir" install
